import Vue from 'vue'
import Router from 'vue-router'

import Home from '@/components/Home'
import Index from '@/components/Index'
import View from '@/components/View'
import Personal from '@/components/Personal'
import AddQuestion from '@/components/AddQuestion'
import PersonalDetail from '@/components/PersonalDetail'
import DiscussionDetail from '@/components/DiscussionDetail'
import MyMsg from '@/components/MyMsg'
import LessonDetail from '@/components/LessonDetail'
import Login from '@/components/Login'
import MyWork from '@/components/MyWork'
import Location from '@/components/Location'
import Search from '@/components/Search'
import Setting from '@/components/Setting'
import Register from '@/components/register'
import MyTalk from '@/components/MyTalk'
import DingDan from '@/components/DingDan'
import RecommendTeacher from '@/components/RecommendTeacher'
import TeacherDetail from '@/components/TeacherDetail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      redirect: "/index",
      component: Home,
      children: [{
        path: 'index',
        name: 'Index',
        component: Index,
      },
        {
          path: 'view',
          name: 'View',
          component: View,
        },
        {
          path: 'personal',
          name: 'Personal',
          component: Personal,
        },
        {
          path: 'search',
          name: 'Search',
          component: Search
        },
        {
          path: 'setting',
          name: 'Setting',
          component: Setting
        },
        {
          path: "/personal/detail",
          name: "PersonalDetail",
          component: PersonalDetail
        },
        {
          path: "/personal/message",
          name: "MyMsg",
          component: MyMsg
        },
        {
          path: "/lesson/detail",
          name: "LessonDetail",
          component: LessonDetail
        },
        {
          path: 'location',
          name: 'Location',
          component: Location
        },
        {
          path: 'recommendteacher',
          name: 'RecommendTeacher',
          component: RecommendTeacher
        },
        {
          path: 'teacherdetail',
          name: 'TeacherDetail',
          component: TeacherDetail
        },

        {
          path: "/add/question",
          name: "question",
          component: AddQuestion
        },
        {
          path: "/user/login",
          name: "Login",
          component: Login
        },
        {
          path: "/user/register",
          name: "Register",
          component: Register
        },
        {
          path: "/user/work",
          name: "MyWork",
          component: MyWork
        },
        {
          path: "/user/mytalk",
          name: "MyTalk",
          component: MyTalk
        }, {
          path: "/user/dingdan",
          name: "DingDan",
          component: DingDan
        }
      ]
    },
    {
      path: "/discussion/detail",
      name: "DiscussionDetail",
      component: DiscussionDetail
    }
  ]
})
